package com.xbts.system.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.xbts.system.domain.CnInvoiceManagement;
import com.xbts.system.domain.CnOrderItem;
import com.xbts.system.domain.SysOperLog;
import com.xbts.system.domain.SysUserInvoiceInformation;
import com.xbts.system.domain.vo.CnOrderStatisticsVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 数据盘Mapper接口
 *
 * @author xbts
 * @date 2023-08-07
 */
public interface CnInvoiceManagementMapper extends BaseMapper<CnInvoiceManagement> {
    /**
     * 查询是否电子发票，邮件地址
     *
     * @param UserId 操作日志对象
     * @return 操作日志集合
     */
    public SysUserInvoiceInformation selectInformation(Long UserId);

    @Select("select su.nick_name,  " +
            " cim.invoice_management_id," +
            " cim.user_id," +
            " cim.order_item_id," +
            " cim.order_item_sn," +
            " cim.shopping_car_enums," +
            " cim.fees_type," +
            " cim.fees_summary," +
            " cim.amount," +
            " cim.payment_time," +
            " cim.invoice_status," +
            " cim.file_url," +
            " cim.invoice_date," +
            " cim.create_by," +
            " cim.create_time," +
            " cim.update_by," +
            " cim.update_time," +
            " cim.remark," +
            " cim.invoice_number," +
            " cim.invoice_content," +
            " cim.nick_name," +
            " cim.invoice_handling_personnel," +
            " cim.invoice_information_id" +
            " from cn_invoice_management as cim " +
            " left join sys_user su on su.user_id = cim.user_id " +
            " ${ew.customSqlSegment}")
    List<CnInvoiceManagement> getList(@Param(Constants.WRAPPER) QueryWrapper<CnInvoiceManagement> queryWrapper);
}
